package main

import (
	"encoding/json"
	"fmt"
)

func main() {
	world := HelloWorld{
		Name: "张三",
	}
	jsonRes, _ := json.Marshal(world)
	fmt.Println(string(jsonRes))

	helloWorld := HelloWorld{}
	json.Unmarshal(jsonRes, &helloWorld)
	fmt.Println(helloWorld.Name)
}

type HelloWorld struct {
	Name string `json:"name"`
}
